<table data-role="table" id="featureTbl" data-mode="reflow" width="100%" cellpadding="5" cellspacing="5" border="1" class="feature">
    <thead>
        <tr>                                        	
            <th width="180">{$language.label.type}</th>
            <th width="150">{$language.label.label}</th>
            <th>{$language.label.value}</th>
            <th width="85">&nbsp;</th>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td colspan="4" align="right">
                <button type="button" class="valueChange" onclick="javascript:addTableRow('featureTbl');">+{$language.label.addrow}</button>
            </td>
        </tr>
    </tfoot>
    <tbody>    
        {if isset($arrFeatures) && $arrFeatures|@count > 0}
            {foreach item=item key=i from=$arrFeatures}                                            
                <tr id="tr_{$i}" data-id="{$i}">
                    <td id="td_tag_{$i}">
                        <select name="featurety" id="tbTag{$i}" style="width:100%;" onchange="javascript:selTag('featureTbl',this.value, {$i});">
                            { html_options options=$language.table.tag selected=$item->tag }
                        </select>
                    </td>
                    <td id="td_lbl_{$i}">
                        <input name="tbLbl{$i}" id="tbLbl{$i}" value="{$item->lbl|escape}" type="text" style="width:100%;"/>
                    </td>
                    <td id="td_val_{$i}">
                        {if $item->tag == "checkbox"}
                            <div id="div_val_{$i}">
                                {foreach item=chk key=index from=$item->val}
                                    <p style="float:left;width:100%;margin-bottom:5px;" id="p_{$i}_{$index}" data-id="0"><input type="checkbox" {if $chk->chk == 1}checked="checked"{/if} id="chk_{$i}_{$index}" name="chk_{$i}_{$index}" value="1" style="width:auto;margin-right:5px;margin-top:2px;"/><input type="text" id="inp_{$i}_{$index}" name="inp_{$i}_{$index}" value="{$chk->inp|escape}" style="width:85%;margin-right:5px;"/><a href="javascript:;" onclick="javascript:removeChk({$index},{$i});">{$language.label.del}</a></p>
                                {/foreach}
                            </li>
                            <p align="center"><button type="button" onclick="javascript:addChk('featureTbl',{$i});">{$language.label.value}</button></p>
                        {elseif $item->tag == "text"}
                            <input type="text" name="tbVal{$i}" value="{$item->val|escape}" id="tbVal{$i}" style="width:100%;"/>
                        {elseif $item->tag == "textarea"}
                            <textarea rows="1" cols="1" name="tbVal{$i}" id="tbVal{$i}" style="width:98%;font-size:11px;font-family:tahoma;padding: 5px 1%;">{$item->val}</textarea>
                        {/if}
                    </td>
                    <td align="right"><button class="valueChange" type="button" onclick="javascript:deleteTableRow('featureTbl',{$i});">-{$language.label.delrow}</button></td>
                </tr>
            {/foreach}
        {else}
            <tr id="tr_0" data-id="0">
                <td id="td_tag_0">
                    <select name="" id="tbTag0" style="width:100%;" onchange="javascript:selTag('featureTbl',this.value, 0);">
                        {html_options options=$language.table.tag}
                    </select>
                </td>
                <td id="td_lbl_0"><input type="text" value="" name="" id="tbLabel0" style="width:100%;"/></td>
                
                <td id="td_val_0">
                    <input type="text" id="tbVal0" name="" value="" style="width:100%;" /></td>
                <td align="right"><button class="valueChange" type="button" onclick="javascript:deleteTableRow(0);">-{$language.label.delrow}</button></td>
            </tr>
        {/if}
    </tbody>
</table>
